<!--<?php
print <<<EOT
-->

<script src="../css/edit.js"></script>
<script>
<!--

function isTrueTime(s) {

    var patrn=/^[\d]{4}-[\d]{2}-[\d]{2}\s[\d]{2}:[\d]{2}$/; 
	
	if (!patrn.exec(s)) {
    	return false;
	}
	
    return true;
} 

function validate(form) {

	if(form.subject.value.length < 2 || form.subject.value.length > 60) {
		showMsg('msg_area', 'Subject must be no more than 60 characters.');
		form.subject.focus();
		return false;
	}
    
	if(form.address.value.length > 100) {
		showMsg('msg_area', 'Address must be no more than 100 characters.');
		form.address.focus();
		return false;
	}
	
	if(!isTrueTime(form.online.value)) {
		showMsg('msg_area', 'Invalid online.');
		form.online.focus();
		return false;
	}
	
	if(!isTrueTime(form.offline.value)) {
		showMsg('msg_area', 'Invalid offline.');
		form.offline.focus();
		return false;
	}
	
	return true;
}

//-->
</script>

<!--Content Start-->
<table width="95%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
    
      <form action="i_news.php" method="post" name="form1" enctype="multipart/form-data" onSubmit="return validate(this)">
      <table width="60%" align="left">
    
      <tr><td>
      <table width="95%" border="0" align="center">
        <tr> 
          <td align="right">&nbsp; </td>
        </tr>
        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="2">
              <tr> 
                <td colspan=2 height=30><span id="msg_area"></span>&nbsp;</td>
              </tr>

              <tr> 
                <td class="tdheader">Subject :</td>
                <td><input type="text" class="text" name="subject" size="36" value="$subject">
                <input type="hidden" name="action" value="add"></td>
              </tr>
              <tr> 
                <td class="tdheader">Address :</td>
                <td><input type="text" class="text" name="address" size="56"></td>
              </tr>
              <tr> 
                <td class="tdheader">Details : </td>
                <td><textarea class="text" name="details" cols="55" rows="20"></textarea></td>
              </tr>
              <tr> 
                <td class="tdheader">Picture :</td>
                <td><input type="file" class="text" name="up_pic" size="45"> </td>
              </tr>
              <tr> 
                <td class="tdheader">Publish :</td>
                <td> <input type="radio" name="publish" value="1" checked>
                  yes 
                  <input type="radio" name="publish" value="0">
                  no </td>
              </tr>
              <tr>
                <td valign="top" class="tdheader">Set Time :</td>
                <td><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000">
                    <tr>
                      <td height="68" bgcolor="#F5F8FD"><table border="0" cellspacing="5" cellpadding="1">
                          <tr> 
                            <td>Online Date: 
                              <input type="text" name="online" class="text" value="2000-01-01 10:00"><!--e.g. 2000-01-01 10:00--></td>
                          </tr>
                          <tr> 
                            <td>Offline Date: 
                              <input type="text" name="offline" class="text" value="2000-01-01 16:00"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  
                </td>
              </tr>                  
              
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     </td></tr>
    
      <tr><td>
      <table width="95%" border="0" align="left">
        <tr> 
          <td align="center">
            <input type="image" src="../images/admin/bt_cancel.gif" width="78" height="23" onclick="location.href='i_news.php'; return false;"> 
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22" onclick="form1.submit"> 
          </td>
        </tr>
      </table>
      </td></tr>
      </table>
      </form>

      <p>&nbsp;</p></td>
  </tr>
</table>
<!--Content End-->

<!--
EOT;
?>-->